Lock-Free, Scalable Read Access to Shared Data  Structures

ABSTRACT

At least one read operation of at least one object of an object graph is initiated. For each corresponding read operation, a reference count of the root object is incremented (with the reference count 1 for the root object initially reflecting a single anchor pointer pointing to the root object). Subsequently, one or more of the objects are changed. Incompatible changes result in the root object, at least one changed object, and any intervening objects within the hierarchy of objects being cloned. The anchor pointer is then linked to the cloned root object. The root object is later dropped when the reference count for the root object is zero. In addition, the object graph is traversed starting at the root object and ending at the at least one changed object removing any edges for such objects. Each object having a reference count of zero is then dropped.

TECHNICAL FIELD

The subject matter described herein relates to techniques providinglock-free and scalable read access to shared structures in a databasekernel.

BACKGROUND

Synchronized access to shared data structures is required in manycomputer programs in order to ensure data consistency of those sharedstructures. In many cases, such shared structures are relatively seldommodified, but read quite often. In order to ensure data consistency,such structures can be locked using read/write locks that are exclusivefor modification for the underlying data and are shared for readingoperations. However, read/write locks are not particularly cheapsynchronization primitives and even read access can cause L2-cachemisses in the CPU, which in turn, can seriously limit performance ofmultiple-core computing systems.

Such problems can be alleviated but at the cost of (potentially much)higher memory usage for a single read/write lock. In particular, onememory cache line can be reserved for each CPU core so that shared locksin a corresponding core cache line can be counted when there is noexclusive lock request present.

However, with such an arrangement, at least two problems still remain.First, the exclusive access excludes reading of the shared structureuntil the corresponding operation is completed. This restriction canlead to performance bottlenecks, especially as modern many-corearchitectures now regularly exceed 100+CPU cores. In the context ofin-memory databases, the problem is even more prominent, because thereis no I/O time, which would dominate query execution time. Second, evenwith optimized read/write locks using one cache line per CPU core, heavymodification load will cause a high ratio of L2 cache misses duringexclusive lock waiting. Ideally, shared readers should never be blockedby the modification of internal structures.

SUMMARY

In one aspect, at least one read operation of at least one object of anobject graph is initiated. The object graph characterizes a hierarchy ofobjects including a root object in which at least a portion of the nodeshave corresponding reference counts specifying a number of edgespointing to the associated object. Both compatible changes can be madeto objects in the graph as well as incompatible changes. Thereafter, foreach corresponding read operation, a reference count of the root objectis incremented (with the reference count of 1 for the root objectinitially reflecting a single anchor pointer pointing to the rootobject). Subsequently, one or more of the objects are changed.Incompatible changes result in the root object, at least one changedobject, and any intervening objects within the hierarchy of objectsbeing cloned. The anchor pointer is then linked to the cloned rootobject. The root object is later dropped when the reference count forthe root object is zero. In addition, the object graph is traversedstarting at the root object and ending at the at least one changedobject removing any edges for such objects. Each object having areference count of zero is then dropped.

In some implementations, the reference counts can be striped across twoor more CPUs. Such an arrangement is beneficial in that it reduces L-2cache misses. Some or all of the objects can be stored in an in-memorydatabase. The database can store data in rows withmonotonically-increasing row identifiers. The database can usemulti-version concurrency control.

In another aspect, a read operation of at least one page of a table isinitiated. The read operation uses an anchor object pointing to a firsttable header object to access the at least one page. The first tableheader object includes a link to a first linked object that includes ahandle to a plurality of pages including the at least one page.Thereafter, the linked object and the table header object are clonedconcurrently with the read operation such that the the cloned linkedobject includes handles to the plurality of pages including the at leastone page. Subsequently, the anchor object is set to point to the clonedtable header object. One additional page can be linked to the clonedlinked object. Thereafter, the first table header object and the firstlinked object are dropped after the read operation is completed.

The tables can be stored in an in-memory database. The first linkedobject can be a versioned object comprising a reference count. Thereference count forcing the in-memory database to maintain the firsttable header object and the first linked object during the readoperations. The cloned table header object can initially be linked tothe first linked object. The first table header object can haveassociated metadata characterizing the corresponding pages. The clonedtable header object can also be associated with the metadata associatedwith the first table header object.

Non-transitory computer program products are also described that storecomputer executable instructions, which, when executed by one or moredata processors of at least one computer, causes the at least onecomputer to perform operations herein. Similarly, computer systems arealso described that may include a processor and a memory coupled to theprocessor. The memory may temporarily or permanently store one or moreprograms that cause the processor to perform one or more of theoperations described herein. In addition, operations specified bymethods can be implemented by one or more data processors either withina single computing system or distributed among two or more computingsystems.

The subject matter described herein provides many advantages. Forexample, with the current subject matter, read operations seeking toaccess a shared data structure are never blocked, so much better usageof CPU resources is possible, even under heavy table modification load.

The details of one or more variations of the subject matter describedherein are set forth in the accompanying drawings and the descriptionbelow. Other features and advantages of the subject matter describedherein will be apparent from the description and drawings, and from theclaims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a diagram illustrating a system including a data storageapplication;

FIG. 2A is a first process flow diagram illustrating lock-free scalableaccess to a data structure;

FIG. 2B is a second process flow diagram illustrating lock-free scalableaccess to a data structure;

FIG. 3 is a diagram illustrating details of the system of FIG. 1; and

FIGS. 4A-4K are diagrams illustrating the creation and use of a clonedtable header object and a cloned linked object to provide read access toa shared data structure during an incompatible modification.

DETAILED DESCRIPTION

FIG. 1 shows an example of a system 100 in which a computing system 102,which can include one or more programmable processors that can becollocated, linked over one or more networks, etc., executes one or moremodules, software components, or the like of a data storage application104. The data storage application 104 can include one or more of adatabase, an enterprise resource program, a distributed storage system(e.g. NetApp Filer available from NetApp of Sunnyvale, Calif.), or thelike.

The one or more modules, software components, or the like can beaccessible to local users of the computing system 102 as well as toremote users accessing the computing system 102 from one or more clientmachines 106 over a network connection 110. One or more user interfacescreens produced by the one or more first modules can be displayed to auser, either via a local display or via a display associated with one ofthe client machines 106. Data units of the data storage application 104can be transiently stored in a persistence layer 112 (e.g. a page bufferor other type of temporary persistency layer), which can write the data,in the form of storage pages, to one or more storages 114, for examplevia an input/output component 116. The one or more storages 114 caninclude one or more physical storage media or devices (e.g. hard diskdrives, persistent flash memory, random access memory, optical media,magnetic media, and the like) configured for writing data for longerterm storage. It should be noted that the storage 114 and theinput/output component 116 can be included in the computing system 102despite their being shown as external to the computing system 102 inFIG. 1.

Data retained at the longer term storage 114 can be organized in pages,each of which has allocated to it a defined amount of storage space. Insome implementations, the amount of storage space allocated to each pagecan be constant and fixed. However, other implementations in which theamount of storage space allocated to each page can vary are also withinthe scope of the current subject matter.

FIG. 2A is a process flow diagram illustrating a method 200A in which,at 210A, at least one read operation of at least one object of an objectgraph is initiated. The object graph characterizes a hierarchy ofobjects including a root object in which at least a portion of the nodeshave corresponding reference counts specifying a number of edgespointing to the associated object. Both compatible changes can be madeto objects in the graph as well as incompatible changes. Thereafter, at220A, for each corresponding read operation, a reference count of thecorresponding object is incremented (with the reference count for theroot object initially reflecting an anchor pointer pointing to the rootobject). Subsequently, at 230A, one or more of the objects are changed.Incompatible changes result, at 240A, in the root object, at least onechanged object, and any intervening objects within the hierarchy ofobjects being cloned. The anchor pointer is then linked, at 250A, to thecloned root object. The root object is later dropped, at 260A, when thereference count for the root object is zero. In addition, the objectgraph is traversed, at 270A, starting at the root object and ending atthe at least one changed object removing any edges for such objects.Each object having a reference count of zero is then dropped.

FIG. 2B is a process flow diagram 200B in which, at 210B, a readoperation of at least one page of a table stored in memory of anin-memory database is initiated. The read operation uses an anchorobject pointing to a first table header object to access the at leastone page. The first table header object includes a link to a firstlinked object that includes a handle to a plurality of pages includingthe at least one page. Thereafter, at 220B, the linked object and thetable header object are cloned concurrently with the read operation. Thecloned linked object includes handles to the plurality of pagesincluding the at least one page. Next, at 230B, the anchor object is setto point to the cloned table header object and, at 240B, at least oneadditional page is linked to the cloned linked object. Subsequently, at250B, the first table header object and the first linked object aredropped after the read operation is completed.

Stated differently, a read operation starts with root object (aliasheader object) of the object graph (in one example, it is the tableheader) and adds one (virtual) reference to this object. In this objectgraph (which is a directed graph), one can have further objects, whichare linked to via references from other objects. Normally, this graph isa tree (i.e., no cycles). Objects are nodes/vertices of the graph,references are the edges (directed). Each reference to an objectsomewhere in the graph is counted, so reference count of the object isthe number of edges pointing to this particular object. Reference countof the root is one (for the anchor) plus number of readers. Thisreference count is actually stored specially (striped over CPU cores) inorder to prevent L2-cache conflicts.

A compatible change does not change the graph or reference counts, justone of the objects in the graph is changed. Incompatible changes willclone the affected object and any objects up to the root of the graph(including root/header object), creating new edges between thoseaffected objects and also new edges between newly cloned objects andoriginally linked objects from old version of the respective object(increasing reference counts in process). All the other objects remainthe same, and are re-linked from the original object graph (i.e., as aresult, there will be a graph with two roots—original root/header objectand a cloned one). When the anchor reference is transferred to thecloned one, the original root object loses a reference. When there is noreader, reference count drops to zero, which means this object will beremoved. Transitively, the edges starting from this object are alsoremoved, which leads to decrementing reference count of linked objectsand eventually their removal. This continues until there is nothing toremove. When a reader is present, it still holds a reference to theoriginal root/header object, so the whole process only happens after thelast reader is finished.

FIG. 3 shows a software architecture 300 consistent with one or morefeatures of the current subject matter. A data storage application 104,which can be implemented in one or more of hardware and software, caninclude one or more of a database application, a network-attachedstorage system, or the like. According to at least some implementationsof the current subject matter, such a data storage application 104 caninclude or otherwise interface with a persistence layer 112 or othertype of memory buffer, for example via a persistence interface 302. Apage buffer 304 within the persistence layer 112 can store one or morelogical pages 306, and optionally can include shadow pages, activepages, and the like. The logical pages 306 retained in the persistencelayer 112 can be written to a storage (e.g. a longer term storage, etc.)114 via an input/output component 116, which can be a software module, asub-system implemented in one or more of software and hardware, or thelike. The storage 114 can include one or more data volumes 310 wherestored pages 312 are allocated at physical memory blocks.

In some implementations, the data storage application 104 can include orbe otherwise in communication with a page manager 314 and/or a savepointmanager 316. The page manager 314 can communicate with a page managementmodule 320 at the persistence layer 112 that can include a free blockmanager 322 that monitors page status information 324, for example thestatus of physical pages within the storage 114 and logical pages in thepersistence layer 112 (and optionally in the page buffer 304). Thesavepoint manager 316 can communicate with a savepoint coordinator 326at the persistence layer 204 to handle savepoints, which are used tocreate a consistent persistent state of the database for restart after apossible crash.

In some implementations of a data storage application 104, the pagemanagement module of the persistence layer 112 can implement a shadowpaging. The free block manager 322 within the page management module 320can maintain the status of physical pages. The page buffer 304 canincluded a fixed page status buffer that operates as discussed herein. Aconverter component 340, which can be part of or in communication withthe page management module 320, can be responsible for mapping betweenlogical and physical pages written to the storage 114. The converter 340can maintain the current mapping of logical pages to the correspondingphysical pages in a converter table 342. The converter 340 can maintaina current mapping of logical pages 306 to the corresponding physicalpages in one or more converter tables 342. When a logical page 306 isread from storage 114, the storage page to be loaded can be looked upfrom the one or more converter tables 342 using the converter 340. Whena logical page is written to storage 114 the first time after asavepoint, a new free physical page is assigned to the logical page. Thefree block manager 322 marks the new physical page as “used” and the newmapping is stored in the one or more converter tables 342.

The persistence layer 112 can ensure that changes made in the datastorage application 104 are durable and that the data storageapplication 104 can be restored to a most recent committed state after arestart. Writing data to the storage 114 need not be synchronized withthe end of the writing transaction. As such, uncommitted changes can bewritten to disk and committed changes may not yet be written to diskwhen a writing transaction is finished. After a system crash, changesmade by transactions that were not finished can be rolled back. Changesoccurring by already committed transactions should not be lost in thisprocess. A logger component 344 can also be included to store thechanges made to the data of the data storage application in a linearlog. The logger component 344 can be used during recovery to replayoperations since a last savepoint to ensure that all operations areapplied to the data and that transactions with a logged “commit” recordare committed before rolling back still-open transactions at the end ofa recovery process.

With some data storage applications, writing data to a disk is notnecessarily synchronized with the end of the writing transaction.Situations can occur in which uncommitted changes are written to diskand while, at the same time, committed changes are not yet written todisk when the writing transaction is finished. After a system crash,changes made by transactions that were not finished must be rolled backand changes by committed transaction must not be lost.

To ensure that committed changes are not lost, redo log information canbe written by the logger component 344 whenever a change is made. Thisinformation can be written to disk at latest when the transaction ends.The log entries can be persisted in separate log volumes while normaldata is written to data volumes. With a redo log, committed changes canbe restored even if the corresponding data pages were not written todisk. For undoing uncommitted changes, the persistence layer 112 can usea combination of undo log entries (from one or more logs) and shadowpaging.

The persistence interface 302 can handle read and write requests ofstores (e.g., in-memory stores, etc.). The persistence interface 302 canalso provide write methods for writing data both with logging andwithout logging. If the logged write operations are used, thepersistence interface 302 invokes the logger 344. In addition, thelogger 344 provides an interface that allows stores (e.g., in-memorystores, etc.) to directly add log entries into a log queue. The loggerinterface also provides methods to request that log entries in thein-memory log queue are flushed to disk.

Log entries contain a log sequence number, the type of the log entry andthe identifier of the transaction. Depending on the operation typeadditional information is logged by the logger 344. For an entry of type“update”, for example, this would be the identification of the affectedrecord and the after image of the modified data.

When the data application 104 is restarted, the log entries need to beprocessed. To speed up this process the redo log is not always processedfrom the beginning Instead, as stated above, savepoints can beperiodically performed that write all changes to disk that were made(e.g., in memory, etc.) since the last savepoint. When starting up thesystem, only the logs created after the last savepoint need to beprocessed. After the next backup operation the old log entries beforethe savepoint position can be removed.

When the logger 344 is invoked for writing log entries, it does notimmediately write to disk. Instead it can put the log entries into a logqueue in memory. The entries in the log queue can be written to disk atthe latest when the corresponding transaction is finished (committed oraborted). To guarantee that the committed changes are not lost, thecommit operation is not successfully finished before the correspondinglog entries are flushed to disk. Writing log queue entries to disk canalso be triggered by other events, for example when log queue pages arefull or when a savepoint is performed.

With the current subject matter, the logger 344 can write a database log(or simply referred to herein as a “log”) sequentially into a memorybuffer in natural order (e.g., sequential order, etc.). If severalphysical hard disks / storage devices are used to store log data,several log partitions can be defined. Thereafter, the logger 344 (whichas stated above acts to generate and organize log data) can load-balancewriting to log buffers over all available log partitions. In some cases,the load-balancing is according to a round-robin distributions scheme inwhich various writing operations are directed to log buffers in asequential and continuous manner. With this arrangement, log bufferswritten to a single log segment of a particular partition of amulti-partition log are not consecutive. However, the log buffers can bereordered from log segments of all partitions during recovery to theproper order.

As stated above, the data storage application 104 can use shadow pagingso that the savepoint manager 316 can write a transactionally-consistentsavepoint. With such an arrangement, a data backup comprises a copy ofall data pages contained in a particular savepoint, which was done asthe first step of the data backup process. The current subject mattercan be also applied to other types of data page storage.

The data storage application 104 can utilize multi-version concurrentcontrol (MVCC) for transaction isolation and consistent reading. Eachrow of the database can be associated with a unique,monotonically-increasing identifier (RowID). When a new version of therecord is created, this new version can also become a new RowID (i.e.,due to MVCC semantics, old versions must be kept for parallel readersand will be cleaned only during garbage collection after commit).

References herein to pages can refer to pages of a table stored inmemory of an in-memory database forming part of the data storageapplication 104. With the MVCC-based database table implementation, allinternal transient data objects of a table can be versioned. These dataobjects can include table a header object, metadata object(s), otherinternal state(s) such as vector of loaded pages, dictionaryhashes/trees for compressed columnar tables, and the like.

With the current subject matter, all table control structures used byreaders can be versioned. These structures include, for example, pagelists, value indirection vectors, internal metadata, and more. Readersdo not acquire any locks on data structure, but rather, work with acurrent version of a data structure until query or query plan operatorends. With this arrangement, old versions only remain for a short periodof time (e.g., sub-seconds). As versioned objects are typically small,memory overhead is also small. In addition, even with OLTP systems,incompatible changes are rare (i.e., there are not many concurrentversions, etc.). Moreover, with some implementations, if older versionsof prioritized/big objects (e.g., main part of a columnar table, etc.)still exist, no new version of the corresponding object can be created.For example, if there is a reader doing a scan on the main part of acolumnar table, which started during columnar table merge from versionn−1 to version n, this scan uses main part in version n−1. Even aftermerge to version n is finished, further merge from version n to versionn+1 will be prevented as long as there are any scans running on mainpart in version n−1 (as this might increase memory demandprohibitively).

The following makes references to the diagrams 400A-400K illustrated inFIGS. 4A-4J. The objects representing a table in memory can be organizedin a tree, which is rooted at table header object 402 and pointed to byan anchor pointer 404. The anchor pointer 404 is used to point to theroot object of the table. The table header object, like all versionedobjects, has a reference count. In the diagram 400A of FIG. 4A, thereference count is 1. Metadata 406 can characterize various aspectsabout the table represented by header object 402 (i.e., to define tablecolumns and their data types, constraints, etc.). The table links to apage vector object 408 that in turn links (via page handles) to aplurality of pages 410 _(1 . . . n) (in this example it is linked to afirst page 410 ₁ and a second page 410 ₂) of an in-memory table loadedin memory. Page handles are a special type of pointer pinning the loadedpage in memory. With the current arrangement, a modification to theinternal structure can be always synchronized against concurrent accessby some means such as a mutex lock or in a more complex implementationby executing all modification operations in a single worker of amessage-passing subsystem.

It will be appreciated that the current subject matter can be utilizedin connection with a variety of different objects and that page vectorobjects are used as one of many implementations. For example, thecurrent subject matter can be applied to object such as dictionary valuevectors, dictionary hash and/or search tree, various metadata objects,etc. In addition, for page vectors, there can be one page vector for adelta part of the table and one for deltas written during a runningmerge operation. There can also be several page vectors for main partcolumns (or several compressed vectors in linear space).

There are in general two types of modifications, namely compatiblemodifications and incompatible modifications. An example of compatiblemodification would be to add a new page handle to a page vector holdingall pages of an in-memory table loaded in memory, as long as the vectordoes not have to be resized.

The current subject matter addresses incompatible modifications. Withreference again to the diagram 400A of FIG. 4A, the page vector 408 issized to link to up to four pages. Adding a third page 410 ₃ (asillustrated in the diagram 400B of FIG. 4B) does not require a resizingof the page vector 408. Changes to the data structure result in a thirdpage 410 ₃ being added. This third page 410 ₃ is then linked to the pagevector 408 and the reference in the table header object is incrementedto 2 to reflect the new version of the header table object 402.Thereafter, as part of a read operation, with reference to the diagram400C of FIG. 4C, a reader 412 is started that accesses the table headerobject 402 to identify the locations in memory of one or more of thelinked pages 410 _(1 . . . 3).

With reference to the diagram 400D of FIG. 4D, changes to the datastructure then result in a fourth page 410 ₄ being added. This fourthpage 410 ₄ is then linked to the page vector 408. Subsequently, as shownin FIG. 4E, changes to the data structure then result in a fifth page410 ₅ being added. In this case, the page vector 408 does not have spacefor a handle to the fifth page 410 ₅. In order to accommodate the fifthpage 410 ₅ the page vector 408 is cloned/copied into a clone page vector414 (as shown in diagram 400F of FIG. 4F) with handles to the first fourpages 410 _(1 . . . 4). In addition, with reference to the diagram 400Gof FIG. 4G, the table header object 402 is cloned into a clone tableheader object 416, and with reference to the diagram 400H of FIG. 4H,the cloned table header object 416 is updated to point from the originalpage vector 408 to the cloned page vector object 414.

Next, with reference to the diagram 4001 of FIG. 4I, the anchor pointerobject 404 is set to the cloned table header object 416 and thereference number of the cloned table header object 416 is incrementedfrom zero to one and the reference number of the original table headerobject 404 is decremented from two to one (because the reference fromthe anchor to the original table header was dropped and a reference tothe new table header was added by updating the anchor point to point tothe new header object). The cloned page vector 414 can store handles toat least five pages and so, with reference to diagram 400J of FIG. 4J,the fifth page 410 ₅ is linked to the cloned page vector object 414. Thereader 412, with reference to the diagram 400J of FIG. 4J can still readdata stored in any of the first four pages 410 _(1 . . . 4) using theold table header object 402. Concurrently, with reference to the diagram400K of FIG. 4K, a sixth page 410 ₆ can be added and linked to thecloned page vector object 414. When the reader 412 ends, with referenceto FIG. 4K, the original table header object 402 and the original pagevector object 408 can be dropped because there are no further referencesto them.

As can be appreciated from the above, the affected data structure (i.e.,the page vector object 412) is cloned and all the objects (e.g., thetable header object 402) on the path from the anchor object 404 to themodified object are cloned. A clone can be considered a shallow copy ofthe object. Only new versions of child objects (in this case a new,resized vector) will be anchored in its parent's clone, other childobjects will just increment their respective reference count (not shownin figures). After the cloning is done, the anchor pointer is updated topoint to the newly-cloned root object (in this case table headerobject).

A reader can increment reference count on the root object of the objecthierarchy (in the current example table header object). This versioningforces holding of the old version of the data in memory (as opposed tohaving the database overwrite such version), even though concurrentmodifications have done incompatible structural changes.

In addition, because the database is using MVCC to access database tabledata, it can read the same data set from both old as well as new datastructures. In the above example, data written to new pages is notvisible to the running transaction of the reader, so it is irrelevantthat the reader cannot read them. Similarly, compatible changes addingnew data to existing pages are also invariant for the reader, because itwill only see its old data. Care must be only taken to order writes andreads in such a way as to ensure consistent dirty read of internalstructures (such as, write to the vector first writes new element andthen increases element count, reader OTOH first reads count, thenaccesses elements). If the writer first increases element count and thenwrites the element, the reader would have a race condition: it couldalready read new element count and access the not-yet-written element(un-initialized memory), which typically leads to a crash and/orincorrect results.

In order to ensure L2-cache friendliness, the anchor pointer object cancontain a reference count of the root object and root object pointerseparately for each CPU core. Thus, the reader only modifiescore-private cache line using an atomic operation to increase referencecount and at the same time reads the current anchor pointer. When anincompatible structural change happens, reference counts of allcore-private counters can be aggregated one-by-one to the referencecount of the root object and the anchor pointer object updatedatomically to contain new root pointer and zero reference count(eventually repeating the operation in case of collision with a reader).Reader leaving an out-of-date structure (different anchor pointer) thenneeds to atomically decrement shared reference count in the old versionof the root object (in our example, table header object) instead of thereference count in the core-private cache line of the anchor pointer.

Aspects of the subject matter described herein can be embodied insystems, apparatus, methods, and/or articles depending on the desiredconfiguration. In particular, various implementations of the subjectmatter described herein can be realized in digital electronic circuitry,integrated circuitry, specially designed application specific integratedcircuits (ASICs), computer hardware, firmware, software, and/orcombinations thereof. These various implementations can includeimplementation in one or more computer programs that are executableand/or interpretable on a programmable system including at least oneprogrammable processor, which can be special or general purpose, coupledto receive data and instructions from, and to transmit data andinstructions to, a storage system, at least one input device, and atleast one output device.

These computer programs, which can also be referred to programs,software, software applications, applications, components, or code,include machine instructions for a programmable processor, and can beimplemented in a high-level procedural and/or object-orientedprogramming language, and/or in assembly/machine language. As usedherein, the term “machine-readable medium” refers to any computerprogram product, apparatus and/or device, such as for example magneticdiscs, optical disks, memory, and Programmable Logic Devices (PLDs),used to provide machine instructions and/or data to a programmableprocessor, including a machine-readable medium that receives machineinstructions as a machine-readable signal. The term “machine-readablesignal” refers to any signal used to provide machine instructions and/ordata to a programmable processor. The machine-readable medium can storesuch machine instructions non-transitorily, such as for example as woulda non-transient solid state memory or a magnetic hard drive or anyequivalent storage medium. The machine-readable medium can alternativelyor additionally store such machine instructions in a transient manner,such as for example as would a processor cache or other random accessmemory associated with one or more physical processor cores.

To provide for interaction with a user, the subject matter describedherein can be implemented on a computer having a display device, such asfor example a cathode ray tube (CRT) or a liquid crystal display (LCD)monitor for displaying information to the user and a keyboard and apointing device, such as for example a mouse or a trackball, by whichthe user may provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well. For example,feedback provided to the user can be any form of sensory feedback, suchas for example visual feedback, auditory feedback, or tactile feedback;and input from the user may be received in any form, including, but notlimited to, acoustic, speech, or tactile input. Other possible inputdevices include, but are not limited to, touch screens or othertouch-sensitive devices such as single or multi-point resistive orcapacitive trackpads, voice recognition hardware and software, opticalscanners, optical pointers, digital image capture devices and associatedinterpretation software, and the like.

The subject matter described herein can be implemented in a computingsystem that includes a back-end component, such as for example one ormore data servers, or that includes a middleware component, such as forexample one or more application servers, or that includes a front-endcomponent, such as for example one or more client computers having agraphical user interface or a Web browser through which a user caninteract with an implementation of the subject matter described herein,or any combination of such back-end, middleware, or front-endcomponents. A client and server are generally, but not exclusively,remote from each other and typically interact through a communicationnetwork, although the components of the system can be interconnected byany form or medium of digital data communication. Examples ofcommunication networks include, but are not limited to, a local areanetwork (“LAN”), a wide area network (“WAN”), and the Internet. Therelationship of client and server arises by virtue of computer programsrunning on the respective computers and having a client-serverrelationship to each other.

The implementations set forth in the foregoing description do notrepresent all implementations consistent with the subject matterdescribed herein. Instead, they are merely some examples consistent withaspects related to the described subject matter. Although a fewvariations have been described in detail herein, other modifications oradditions are possible. In particular, further features and/orvariations can be provided in addition to those set forth herein. Forexample, the implementations described above can be directed to variouscombinations and sub-combinations of the disclosed features and/orcombinations and sub-combinations of one or more features further tothose disclosed herein. In addition, the logic flows depicted in theaccompanying figures and/or described herein do not necessarily requirethe particular order shown, or sequential order, to achieve desirableresults. The scope of the following claims may include otherimplementations or embodiments.

What is claimed is:
 1. A method comprising: initiating at least one readoperation of at least one object of an object graph, the object graphcharacterizing a hierarchy of objects including a root object, at leasta portion of the nodes having corresponding reference counts specifyinga number of edges pointing to the associated object, wherein compatiblechanges can be made to objects in the graph and incompatible changes canbe made to objects in the graph; incrementing, for each correspondingread operation, a reference count of the root object, the referencecount for the root object initially reflecting an anchor pointerpointing to the root object; changing one or more objects; cloning theroot object, at least one changed object, and any intervening objectswithin the hierarchy of objects if incompatible changes have been madeto the at least one changed object; linking the anchor pointer to thecloned root object; dropping the root object when the reference countfor the root object is zero; traversing the object graph starting at theroot object and ending at the at least one changed object removing anyedges for such objects; and dropping each object when its correspondingreference count becomes zero.
 2. A method as in claim 1, wherein thereference counts are striped across two or more CPUs.
 3. A method as inclaim 1, wherein at least one of the objects are stored in an in-memorydatabase.
 4. A method as in claim 3, wherein the database stores data inrows with monotonically-increasing row identifiers.
 5. A method as inclaim 4, wherein the database uses multi-version concurrency control. 6.A non-transitory computer program product storing instructions that,when executed by at least one programmable processor, cause the at leastone programmable processor to perform operations comprising: initiatinga read operation of at least one page of a table, the read operationusing an anchor object pointing to a first table header object to accessthe at least one page, the first table header object including a link toa first linked object, the first linked object comprising a handle to aplurality of pages including the at least one page; cloning the linkedobject and the table header object concurrently with the read operation,the cloned linked object comprising handles to the plurality of pagesincluding the at least one page; setting the anchor object to point tothe cloned table header object; linking at least one additional page tothe cloned linked object; and dropping the first table header object andthe first linked object after the read operation is completed.
 7. Acomputer program product as in claim 6, wherein the tables are stored inan in-memory database.
 8. A computer program product as in claim 7,wherein the first linked object is a versioned object comprising areference count, the reference count forcing the in-memory database tomaintain the first table header object and the first linked objectduring the read operations.
 9. A computer program product as in claim 7,wherein the database stores data in rows with monotonically-increasingrow identifiers.
 10. A computer program product as in claim 7, whereinthe database uses multi-version concurrency control.
 11. A computerprogram product as in claim 8, wherein the reference counts are stripedacross two or more CPUs.
 12. A computer program product as in claim 6,wherein the cloned table header object is initially linked to the firstlinked object.
 13. A computer program product as in claim 6, wherein thefirst table header object has associated metadata characterizing thecorresponding pages.
 14. A computer program product as in claim 6,wherein the cloned table header object is also associated with themetadata associated with the first table header object.
 15. Anon-transitory computer program product storing instructions that, whenexecuted by at least one programmable processor, cause the at least oneprogrammable processor to perform operations comprising: initiating atleast one read operation of at least one object of an object graph, theobject graph characterizing a hierarchy of objects including a rootobject, at least a portion of the nodes having corresponding referencecounts specifying a number of edges pointing to the associated object,wherein compatible changes can be made to objects in the graph andincompatible changes can be made to objects in the graph; incrementing,for each corresponding read operation, a reference count of thecorresponding object, the reference count of the root object initiallyreflecting an anchor pointer pointing to the root object; changing oneor more objects; cloning the root object, at least one changed object,and any intervening objects within the hierarchy of objects ifincompatible changes have been made to the at least one changed object;linking the anchor pointer to the cloned root object; dropping the rootobject when the reference count for the root object is zero; traversingthe object graph starting at the root object and ending at the at leastone changed object removing any edges for such objects; and droppingeach object when its corresponding reference count becomes zero.
 16. Acomputer program product as in claim 15, wherein the reference countsare striped across two or more CPUs.
 17. A computer program product asin claim 15, wherein at least one of the objects are stored in anin-memory database.
 18. A computer program product as in claim 17,wherein the database stores data in rows with monotonically-increasingrow identifiers.
 19. A computer program product as in claim 17, whereinthe database uses multi-version concurrency control.